package com.open.auth.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.open.auth.entity.ResponseResult;
import com.open.auth.entity.User;
import com.open.auth.service.LoginService;

@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/user/login")
    public ResponseResult<Map<String,String>> login(@RequestBody User user){
        return loginService.login(user);
    }
    @RequestMapping("/user/logout")
    public ResponseResult<String> logout(){
        return loginService.logout();
    }
}
